<div class="grid_16">
	<div id="ps-invoice-index" class="box">
		<h2 class="box_head grad_colour with-icon"><img width="16" height="16" src="/images/icons/fugue/folder.png" />Tickets</h2>
			<?php
			$this->widget('PsGridView', array(
				'id' => 'invoice-index-grid',
				'dataProvider' => $ticket->search(),
				'filter' => $ticket,
				'template' => '{items}{pager}{pagesize}',
				'htmlOptions' => array(
					'class' => 'grid-view grey'
				),
				'pagerCssClass' => 'pager float-right',
				'pagesizeCssClass' => 'pager-pagesize float-right',
				'columns' => array(
					array(
						'header' => 'Date',
						'name' => 'create_time',
						'type' => 'date',
						'htmlOptions' => array('width' => 100),
					),
					array(
						'header' => '#',
						'type' => 'raw',
						'name' => 'ticket_number',
						'value' => 'CHtml::link("#" . $data->ticket_number, array("public/view", "ticket_number" => $data->ticket_number, "email" => $data->email, "agency_id" => $this->grid->controller->agency->id), array("class" => "blue link"))',
						'htmlOptions' => array('width' => 50),
					),
					array(
						'name' => 'subject',
						'type' => 'raw',
						'value' => 'CHtml::link($data->subject, array("public/view", "ticket_number" => $data->ticket_number, "email" => $data->email, "agency_id" => $this->grid->controller->agency->id), array("class" => "blue link"))',
					),
					array(
						'name' => 'current_status',
						'value' => '$data->current_status',
						'filter' => CHtml::listData(TicketStatusType::model()->findAll(), 'code', 'code'),
						'htmlOptions' => array('width' => 80),
					),
					array(
						'name' => 'type',
						'filter' => CHtml::listData(TicketType::model()->findAll(), 'code', 'code'),
						'htmlOptions' => array('width' => 80),
					),
					array(
						'name' => 'source',
						'filter' => CHtml::listData(TicketSource::model()->findAll(), 'code', 'code'),
						'htmlOptions' => array('width' => 80),
					),
					array(
						'header' => 'From',
						'name' => 'name',
						'htmlOptions' => array('width' => 200),
					),
				)
			));
			?>
	</div>
</div>